/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import {request} from '@umijs/max';
import {headerConfig, responseIntercept} from "@/services/request";
import {getImBaseUrl} from "@/constants";

// 获取群列表
export async function groupGetGroups(
    groupID?: string,
    pagination?: {
        pageNumber: number,
        showNumber: number,
    }
) {
    return request<API.Result_>(`${getImBaseUrl()}/group/get_groups`, {
        method: 'POST',
        data: {
            groupID: groupID,
            pagination: pagination
        },
        headers: headerConfig(),
        responseInterceptors: [responseIntercept],
    });
}

// 获取组成员列表
export async function groupGetGroupMemberList(
    groupID: string,
    pagination: {
        pageNumber: number,
        showNumber: number,
    }
) {
    return request<API.Result_>(`${getImBaseUrl()}/group/get_group_member_list`, {
        method: 'POST',
        data: {
            groupID: groupID,
            pagination: pagination
        },
        headers: headerConfig(),
        responseInterceptors: [responseIntercept],
    });
}

// 获取组成员列表
export async function groupKickGroup(
    groupID: string,
    kickedUserIDs:string[],
    reason:string
) {
    return request<API.Result_>(`${getImBaseUrl()}/group/kick_group`, {
        method: 'POST',
        data: {
            groupID: groupID,
            kickedUserIDs: kickedUserIDs,
            reason: reason,
        },
        headers: headerConfig(),
        responseInterceptors: [responseIntercept],
    });
}

// 解散群组
export async function groupDismissGroup(
    groupID: string
) {
    return request<API.Result_>(`${getImBaseUrl()}/group/dismiss_group`, {
        method: 'POST',
        data: {
            groupID: groupID,
        },
        headers: headerConfig(),
        responseInterceptors: [responseIntercept],
    });
}

// 禁言群组
export async function groupMuteGroup(
    groupID: string
) {
    return request<API.Result_>(`${getImBaseUrl()}/group/mute_group`, {
        method: 'POST',
        data: {
            groupID: groupID,
        },
        headers: headerConfig(),
        responseInterceptors: [responseIntercept],
    });
}

// 取消禁言群组
export async function groupCancelMuteGroup(
    groupID: string
) {
    return request<API.Result_>(`${getImBaseUrl()}/group/cancel_mute_group`, {
        method: 'POST',
        data: {
            groupID: groupID,
        },
        headers: headerConfig(),
        responseInterceptors: [responseIntercept],
    });
}
